<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="../../../../../build/css/onsenui.css"/>
    <link rel="stylesheet" href="../../../../../build/css/onsen-css-components.css"/>

    <script src="../../../../../build/js/onsenui.js"></script>
    <script src="../../../node_modules/angular/angular.js"></script>
    <script src="../../../../../build/js/angular-onsenui.js"></script>

    <script>
      ons.bootstrap();
    </script>
  </head>
  <body>
    <ons-navigator page="page1.html" title="Navigator" var="myNavigator" ng-init="pops = 0; pushes = 0" ons-postpop="pops = pops + 1" ons-postpush="pushes = pushes + 1"></ons-navigator>

    <ons-template id="page1.html">
      <ons-page id="page1" ng-init="status = 'init';">
        <div style="text-align: center;">
          <p>Page 1</p>
          <br>
          <p>Pops: <span id="pops">{{ pops }}</span>, pushes: <span id="pushes">{{ pushes }}</span>, status: <span id="status">{{ status }}</p>
          <ons-button id="btn1" ng-click="status = 'modified'; myNavigator.pushPage('page2.html')">Push</ons-button>
          <ons-button id="btn1-pop" ng-click="myNavigator.popPage()">Pop</ons-button>
        </div>
      </ons-page>
    </ons-template>

    <ons-template id="page2.html">
      <ons-page id="page2">
        <div style="text-align: center;">
          <p>Page 2</p>
          <br>
          <ons-button id="btn2" ng-click="myNavigator.popPage()">Pop Page</ons-button>
          <ons-button id="btn3" ng-click="myNavigator.replacePage('page3.html')">Replace Page</ons-button>
          <ons-button id="btn4-device-backbutton" ng-click="ons.fireDeviceBackButtonEvent()">Fire 'backbutton' event.</ons-button>
          <ons-button id="btn6-reset" ng-click="myNavigator.resetToPage()">Reset To Page</ons-button>
          <ons-button id="btn-insert1" ng-click="myNavigator.insertPage(-1, 'background_1.html', {hoge: 'hoge'})"> Insert Background (Front)</ons-button>
          <ons-button id="btn-insert2" ng-click="myNavigator.insertPage(0, 'background_2.html')"> Insert Background (Back)</ons-button>
          <ons-button id="btn-remove" ng-click="myNavigator.removePage(0)"> Remove Background</ons-button>
        </div>
      </ons-page>
    </ons-template>

    <ons-template id="page3.html">
      <ons-page id="page3">
        <div style="text-align: center;">
          <p>Page 3</p>
          <br>
          <ons-button id="btn4" ng-click="myNavigator.popPage()">Pop Page</ons-button>
        </div>
      </ons-page>
    </ons-template>

    <ons-template id="background_1.html">
       <ons-page id="background_1">
         <div style="text-align: center;">
           <p>Background Page 1</p>
           <br>
           <ons-button id="background_1_btn" ng-click="myNavigator.popPage()">Pop Page</ons-button>
         </div>
       </ons-page>
     </ons-template>

     <ons-template id="background_2.html">
       <ons-page id="background_2">
         <div style="text-align: center;">
           <p>Background Page 2</p>
           <br>
           <ons-button ng-click="myNavigator.popPage()">Pop Page</ons-button>
         </div>
       </ons-page>
     </ons-template>

  </body>
</html>
